﻿
<div class="panel panel-default padding-empty">
    <div class="panel-body padding-empty">
        <ol class="breadcrumb margin-empty">
            <li class="breadcrumb-color"><i class="fa fa-home"></i>&nbsp;主页</li>
            <li><a href="#/examReport/planList" class="breadcrumb-link">考试结果管理</a></li>
            <li class="active">{{planName}} - 统考结果管理</li>
        </ol>
    </div>
</div>

<div class="panel panel-default">
    <div class="panel-heading">
        <!--<h3>
            <i class="fa fa-desktop"></i>
            {{planName}} - 考试结果管理

            &nbsp;
            <button class="btn btn-turquoise btn-xs" onclick="javascript:history.go(-1);" title="返回上一页" style="margin-bottom: 0;">
                <i class="fa fa-chevron-left"></i>
            </button>
        </h3>-->

        <div class="panel-options">
            <!-- TODO: 2016.09.06 隐藏
            <button class="btn btn-turquoise" ng-click="upload();" ng-disabled="loadingState">
                <i class="fa fa-upload"></i>
                考试结果上传
            </button>
            -->
            <button class="btn btn-turquoise" ng-click="signInReport();" ng-disabled="loadingState">
                <i class="fa fa-file-text-o"></i>
                签到报告
            </button>
            <button class="btn btn-turquoise" ng-click="download();" ng-disabled="loadingState">
                <i class="fa fa-download"></i>
                考试结果导出
            </button>
        </div>
    </div>

    <div class="panel-body">
        <!--下拉框搜素-->
        <form class="form-inline">
            <div class="form-group">
                <label class="control-label">场次：</label>
                <select ng-model="curScene" ng-options="item.examSceneName for item in sceneList" class="form-control selectMaxWidth"></select>
            </div>

            <div class="form-group">
                <label class="control-label">考场：</label>
                <select ng-model="curRoom" ng-options="item.examRoomName for item in roomList" class="form-control selectMaxWidth"></select>
            </div>

            <div class="form-group">
                <label class="control-label">科目：</label>
                <select ng-model="curSubject" ng-options="item.subjectName for item in subjectList" class="form-control selectMaxWidth"></select>
            </div>

            <div class="form-group">
                <label class="control-label">状态：</label>
                <select ng-model="curStatus" ng-options="item.statusName for item in statusList" class="form-control selectMaxWidth"></select>
            </div>

            &nbsp;
            &nbsp;

            <button class="btn btn-turquoise" ng-click="query();" style="margin-bottom: 0;">
                <i class="fa fa-search"></i>
                搜索
            </button>
        </form>

        <br />
        <table class="table responsive table-bordered table-hover table-condensed">
            <thead>
                <tr class="active">
                    <th class="text-center">
                        <input type="checkbox" ng-click="checkAll();" title="全选" ng-disabled="loadingState" />
                    </th>
                    <th class="text-center">#</th>
                    <th>场次</th>
                    <th>考场</th>
                    <th>科目</th>
                    <!--<th>报考数</th>-->
                    <!--<th>缺考数</th>-->
                    <th>状态</th>
                    <th>上传时间</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <tr ng-repeat="item in list" ng-click="check(item);" style="cursor: pointer;">
                    <td class="text-center">
                        <input type="checkbox" id="cbx_{{item.examReportID}}" value="{{item.examReportID}}" ng-click="check(item);" ng-disabled="loadingState" />
                    </td>
                    <!--序号-->
                    <td class="text-center">
                        {{$index+1}}
                    </td>
                    <!--场次-->
                    <td>
                        {{item.examSceneName}}
                    </td>
                    <!--考场-->
                    <td title="{{item.examRoomName}}">
                        {{item.examRoomName | formatLongStr}}
                    </td>
                    <!--科目-->
                    <td title="{{item.examSubjectName}}">
                        {{item.examSubjectName | formatLongStr}}
                    </td>
                    <!--报考人数-->
                    <!--<td>
                        {{item.AllCount}}
                    </td>-->
                    <!--缺考人数-->
                    <!--<td>
                        {{item.AbsentCount}}
                    </td>-->
                    <!--状态-->
                    <td ng-switch on="item.examReportState">
                        <span ng-switch-when="0">未生成</span>
                        <span ng-switch-when="1">已生成未上传</span>
                        <span ng-switch-when="2">已生成</span>
                        <span ng-switch-when="3">上传中</span>
                        <span ng-switch-when="4">已上传</span>
                    </td>
                    <!--上传时间-->
                    <td ng-switch on="item.examStatus">
                        <span ng-switch-default>{{item.uploadTime | formatDate | date: 'yyyy-MM-dd HH:mm:ss'}}</span>
                        <span ng-switch-when="0"></span>
                    </td>
                    <!--操作-->
                    <td>
                        <button class="btn btn-turquoise btn-sm" ng-click="detail(item);">
                            <i class="fa fa-file-text-o"></i>
                            查看明细
                        </button>
                        <button class="btn btn-turquoise btn-sm" ng-click="build(item);" ng-disabled="loadingState">
                            <i class="fa fa-file-o"></i>
                            生成报告
                            <i id="loading_{{item.examReportID}}" class="fa fa-spinner fa-spin tag-hide"></i>
                        </button>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>

    <div role="tabpanel" class="tab-pane active" ng-if="list.length <= 0">
        <h3 class="text-center">
            <img src="//openexamcdn.open.com.cn/openexam/static/App/images/nodata.jpg" alt="" />
            <!--<small>对不起，没有相关数据！</small>-->
        </h3>
    </div>
</div>
